package com.newtype.meeting.shared;

import java.io.Serializable;
import java.util.List;

import com.extjs.gxt.ui.client.data.BaseTreeModel;

@SuppressWarnings("serial")
public class DepartmentTreeDTO extends BaseTreeModel implements Serializable {

	public DepartmentTreeDTO() {
		
	}

	public DepartmentTreeDTO(String id, String name) {
		set("id", id);
		set("name", name);
	}

	public void setDepartmentChildren(List<DepartmentTreeDTO> children) {
		for (int i = 0; i < children.size(); i++) {
			add(children.get(i));
		}
	}

	public void setAccountChildren(List<AccountTreeDTO> children) {
		for (int i = 0; i < children.size(); i++) {
			add(children.get(i));
		}
	}

	public String getId() {
		return (String) get("id");
	}

	public String getName() {
		return (String) get("name");
	}

	public String toString() {
		return getName();
	}

}
